using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WalkingTec.Mvvm.Core;

namespace HengTong.Model.Db.Article;

/// <summary>
/// 文章分类实体类
/// </summary>
public class SysArticleCategory : TreePoco<SysArticleCategory>
{
    [Required]
    [Display(Name = "分类名称", Description = "文章分类名称", GroupName = "基本信息")]
    [StringLength(128)]
    public string CategoryName { get; set; }

    [Display(Name = "分类编码", Description = "分类编码，用于系统内部标识", GroupName = "基本信息")]
    [StringLength(64)]
    public string CategoryCode { get; set; }

    [Display(Name = "分类描述", Description = "分类的详细描述", GroupName = "基本信息")]
    [StringLength(512)]
    public string Description { get; set; }

    [Display(Name = "分类图标", Description = "分类显示图标", GroupName = "显示设置")]
    [StringLength(128)]
    public string Icon { get; set; }

    [Display(Name = "分类颜色", Description = "分类标识颜色", GroupName = "显示设置")]
    [StringLength(32)]
    public string Color { get; set; }

    [Display(Name = "排序", Description = "分类显示排序，数值越小越靠前", GroupName = "显示设置")]
    public int? SortOrder { get; set; }

    [Display(Name = "是否启用", Description = "是否启用此分类", GroupName = "状态设置")]
    public bool IsActive { get; set; } = true;

    [Display(Name = "是否显示", Description = "是否在前端显示", GroupName = "状态设置")]
    public bool IsVisible { get; set; } = true;
    
    // 导航属性
    [Display(Name = "文章列表")]
    public virtual ICollection<SysArticle> Articles { get; set; }
} 